package co.yixiang.modules.system.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

@Getter
@AllArgsConstructor
public enum CardStatusEnum {

	/**
	 * 初始
	 */
	INIT("1", "初始"),

	/**
	 * 流通中
	 */
	PROCESS("2", "流通中"),

	/**
	 * 激活
	 */
	ACTIVATION("3", "激活");

	private String value;

	private String desc;

	public static CardStatusEnum toType(String value) {
		return Stream.of(CardStatusEnum.values())
				.filter(p -> p.value.equals(value))
				.findAny()
				.orElse(null);
	}

	public String value() {
		return this.value;
	}

}
